from jdbcdao.iconnection import Iconnect
import mysql.connector

'''mysql 数据库连接的实现'''


class MysqlConnection(Iconnect):

    def __init__(self, user, pwd, database):
        self.user = user
        self.pwd = pwd
        self.database = database

    def get_connect(self):
        conn = mysql.connector.connect(user=self.user, password=self.pwd, database=self.database, use_unicode=True)
        print('mysql db is connect success')
        return conn




